home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_110 / mint / readline.zoo / readline / Makefile < prev    next >
Encoding:
Makefile  |  1991-11-05  |  3.9 KB  |  135 lines

  1. ## -*- text -*- ####################################################
  2. #                                   #
  3. # Makefile for readline and history libraries.               #
  4. #                                   #
  5. ####################################################################
  6.  
  7. # Here is a rule for making .o files from .c files that doesn't force
  8. # the type of the machine (like -sun3) into the flags.
  9. .c.o:
  10.     $(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) \
  11.         $(READLINE_DEFINES) $(CPPFLAGS) $*.c
  12.  
  13. # Destination installation directory.  The libraries are copied to DESTDIR
  14. # when you do a `make install', and the header files to INCDIR/readline/*.h.
  15. DESTDIR = /usr/local/lib
  16. INCDIR = /usr/local/include
  17.  
  18. # Define TYPES as -DVOID_SIGHANDLER if your operating system uses
  19. # a return type of "void" for signal handlers.
  20. # TYPES = -DVOID_SIGHANDLER
  21.  
  22. # Define USG as -DUSG if you are using a System V operating system.
  23. #USG = -DUSG
  24.  
  25. # HP-UX compilation requires the BSD library.
  26. #LOCAL_LIBS = -lBSD
  27.  
  28. # Xenix compilation requires -ldir -lx
  29. #LOCAL_LIBS = -ldir -lx
  30.  
  31. # Comment out "-DVI_MODE" if you don't think that anyone will ever desire
  32. # the vi line editing mode and features.  Make sure to comment out the
  33. # definition of VI if you remove the -DVI_MODE.
  34. READLINE_DEFINES = $(TYPES) -DVI_MODE
  35.  
  36. DEBUG_FLAGS = -g
  37. LDFLAGS = $(DEBUG_FLAGS) 
  38. CFLAGS = $(DEBUG_FLAGS) $(USG) -I.
  39.  
  40. # A good alternative is gcc -traditional.
  41. #CC = gcc -traditional
  42. CC = cc
  43. RANLIB = /usr/bin/ranlib
  44. AR = ar
  45. RM = rm
  46. CP = cp
  47.  
  48. LOCAL_INCLUDES = -I../
  49.  
  50. XMALLOC_C = ../malloc/xmalloc.c
  51. XMALLOC_O = ../malloc/xmalloc.o
  52.  
  53. TILDE_C = ../glob/tilde.c
  54. TILDE_O = ../glob/tilde.o
  55.  
  56. CSOURCES = readline.c history.c funmap.c keymaps.c vi_mode.c \
  57.        emacs_keymap.c vi_keymap.c $(XMALLOC_C) $(TILDE_C)
  58.  
  59. HSOURCES = readline.h chardefs.h history.h keymaps.h
  60. SOURCES  = $(CSOURCES) $(HSOURCES)
  61.  
  62. OBJECTS = readline.o vi_mode.o history.o funmap.o keymaps.o \
  63.         $(XMALLOC_O) $(TILDE_O)
  64.  
  65. DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo \
  66.         doc/hist.texinfo doc/hsuser.texinfo doc/hstech.texinfo
  67. DOCOBJECT = doc/readline.dvi doc/history.dvi
  68. DOCSUPPORT = doc/Makefile doc/texinfo.tex
  69. DOCUMENTATION = $(DOCSOURCE) $(DOCOBJECT) $(DOCSUPPORT)
  70.  
  71. SUPPORT = COPYING Makefile $(DOCUMENTATION) ChangeLog examples
  72.  
  73. THINGS_TO_TAR = $(SOURCES) $(SUPPORT)
  74.  
  75. ##########################################################################
  76.  
  77. all: libreadline.a
  78.  
  79. libreadline.a:    $(OBJECTS)
  80.     $(RM) -f $@
  81.     $(AR) clq $@ $(OBJECTS)
  82.     -if [ -f "$(RANLIB)" ]; then $(RANLIB) libreadline.a; fi
  83.  
  84. readline: readline.h chardefs.h $(OBJECTS)
  85.     $(CC) $(CFLAGS) $(CPPFLAGS) $(READLINE_DEFINES) \
  86.       $(LOCAL_INCLUDES) -DTEST -o readline readline.c vi_mode.o funmap.o \
  87.       $(TILDE_O) $(XMALLOC_O) keymaps.o history.o -L. -ltermcap
  88.  
  89. $(TILDE_O): $(TILDE_C)
  90.     rm -f tilde.o
  91.     $(CC) $(CFLAGS) $(CPPFLAGS) -c $(TILDE_C)
  92.     @-mv tilde.o $(TILDE_O)
  93.  
  94. $(XMALLOC_O): $(XMALLOC_C)
  95.     rm -f $(XMALLOC_O)
  96.     $(CC) $(CFLAGS) $(CPPFLAGS) -c $(XMALLOC_C)
  97.     @-mv xmalloc.o $(XMALLOC_O)
  98.  
  99. readline.o:    readline.c readline.h chardefs.h  keymaps.h history.h
  100. history.o:    history.c history.h
  101. vi_mode.o:    vi_mode.c
  102. funmap.o:    funmap.c readline.h
  103. keymaps.o:    keymaps.c emacs_keymap.c vi_keymap.c keymaps.h chardefs.h
  104.  
  105. documentation: force
  106.     (cd doc; make)
  107. force:
  108.  
  109. readline.tar:    $(THINGS_TO_TAR)
  110.     tar -cf readline.tar $(THINGS_TO_TAR)
  111.  
  112. readline.tar.Z:    readline.tar
  113.     compress -f readline.tar
  114.  
  115. install:    $(DESTDIR)/libreadline.a includes
  116.  
  117. # The rule for 'includes' is written funny so that the if statement
  118. # always returns TRUE unless there really was an error installing the
  119. # include files.
  120. includes:
  121.     if [ -r $(INCDIR)/readline ]; then \
  122.       :; \
  123.     else \
  124.       mkdir $(INCDIR)/readline && chmod a+r $(INCDIR)/readline; \
  125.     fi
  126.     $(CP) readline.h keymaps.h chardefs.h $(INCDIR)/readline/
  127. clean:
  128.     rm -f $(OBJECTS) *.a
  129.     (cd doc; make clean)
  130.  
  131. $(DESTDIR)/libreadline.a: libreadline.a
  132.     -mv $(DESTDIR)/libreadline.a $(DESTDIR)/libreadline.old
  133.     cp libreadline.a $(DESTDIR)/libreadline.a
  134.     if [ -f "$(RANLIB)" ]; then $(RANLIB) -t $(DESTDIR)/libreadline.a; fi
  135.